// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   ObjectPoolConfig.java

package org.quickserver.util.xmlreader;


// Referenced classes of package org.quickserver.util.xmlreader:
//            PoolConfig, ByteBufferObjectPoolConfig, ClientHandlerObjectPoolConfig, ThreadObjectPoolConfig, 
//            ClientDataObjectPoolConfig

public class ObjectPoolConfig extends PoolConfig
{

    public ObjectPoolConfig()
    {
        poolManager = null;
    }

    public String getPoolManager()
    {
        if(poolManager == null)
            poolManager = "org.quickserver.net.server.impl.BasicPoolManager";
        return poolManager;
    }

    public void setPoolManager(String poolManager)
    {
        this.poolManager = poolManager;
    }

    public ByteBufferObjectPoolConfig getByteBufferObjectPoolConfig()
    {
        if(byteBufferObjectPoolConfig == null)
            byteBufferObjectPoolConfig = new ByteBufferObjectPoolConfig(this);
        return byteBufferObjectPoolConfig;
    }

    public void setByteBufferObjectPoolConfig(ByteBufferObjectPoolConfig byteBufferObjectPoolConfig)
    {
        this.byteBufferObjectPoolConfig = byteBufferObjectPoolConfig;
    }

    public ClientHandlerObjectPoolConfig getClientHandlerObjectPoolConfig()
    {
        if(clientHandlerObjectPoolConfig == null)
            clientHandlerObjectPoolConfig = new ClientHandlerObjectPoolConfig(this);
        return clientHandlerObjectPoolConfig;
    }

    public void setClientHandlerObjectPoolConfig(ClientHandlerObjectPoolConfig clientHandlerObjectPoolConfig)
    {
        this.clientHandlerObjectPoolConfig = clientHandlerObjectPoolConfig;
    }

    public ThreadObjectPoolConfig getThreadObjectPoolConfig()
    {
        if(threadObjectPoolConfig == null)
            threadObjectPoolConfig = new ThreadObjectPoolConfig(this);
        return threadObjectPoolConfig;
    }

    public void setThreadObjectPoolConfig(ThreadObjectPoolConfig threadObjectPoolConfig)
    {
        this.threadObjectPoolConfig = threadObjectPoolConfig;
    }

    public ClientDataObjectPoolConfig getClientDataObjectPoolConfig()
    {
        if(clientDataObjectPoolConfig == null)
            clientDataObjectPoolConfig = new ClientDataObjectPoolConfig(this);
        return clientDataObjectPoolConfig;
    }

    public void setClientDataObjectPoolConfig(ClientDataObjectPoolConfig clientDataObjectPoolConfig)
    {
        this.clientDataObjectPoolConfig = clientDataObjectPoolConfig;
    }

    public String toXML(String pad)
    {
        if(pad == null)
            pad = "";
        StringBuilder sb = new StringBuilder();
        sb.append(pad).append("<object-pool>\n");
        sb.append(pad).append("\t<max-active>").append(getMaxActive()).append("</max-active>\n");
        sb.append(pad).append("\t<max-idle>").append(getMaxIdle()).append("</max-idle>\n");
        sb.append(pad).append("\t<init-size>").append(getInitSize()).append("</init-size>\n");
        sb.append(getThreadObjectPoolConfig().toXML((new StringBuilder(String.valueOf(pad))).append("\t").toString()));
        sb.append(getClientHandlerObjectPoolConfig().toXML((new StringBuilder(String.valueOf(pad))).append("\t").toString()));
        sb.append(getByteBufferObjectPoolConfig().toXML((new StringBuilder(String.valueOf(pad))).append("\t").toString()));
        sb.append(getClientDataObjectPoolConfig().toXML((new StringBuilder(String.valueOf(pad))).append("\t").toString()));
        sb.append(pad).append("\t<pool-manager>").append(getPoolManager()).append("</pool-manager>\n");
        sb.append(pad).append("</object-pool>\n");
        return sb.toString();
    }

    private ThreadObjectPoolConfig threadObjectPoolConfig;
    private ClientHandlerObjectPoolConfig clientHandlerObjectPoolConfig;
    private ByteBufferObjectPoolConfig byteBufferObjectPoolConfig;
    private ClientDataObjectPoolConfig clientDataObjectPoolConfig;
    private String poolManager;
}
